<div class="view-body">
    <div class="view-inner">
        <div ui-view></div>
        <div class="view-cont system-admin-cont">
            <header class="view-cont-hd clearfix">
                <h2 class="pull-left"><span class="line"></span>密码策略管理</h2>
                <ol class="breadcrumb">
                    <li>
                        <span>首页</span>
                    </li>
                    <li class="active">
                        <strong>密码策略</strong>
                    </li>
                </ol>
            </header>
            <section class="view-cont-bd">
                <div class="row-pane">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="handle-bar">
                                <button type="button" ng-click="vm.openCreate()" class="btn btn-default"><i class="fa fa-plus"></i>新建</button>
                                <div class="form-group form-inline pull-right">
                                    <div class="input-group input-select-group">
                                        <span class="pull-left margin-top-5 margin-left-5" ng-if="vm.searching"><i class="fa fa-spin fa-spinner"></i></span>
                                        <input type="text" class="form-control" ng-model="vm.data.q" ng-keyup="vm.makeSearch($event)" placeholder="按名称查询">
                                        <button class="btn btn-default btn-xl" ng-click="vm.makeSearch()"><i class="fa fa-search"></i>搜索</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row-pane panel">
                    <div class="panel-body">
                        <table class="table">
                            <thead>
                            <tr>
                                <th style="width:5%">#</th>
                                <th style="width:10%">名称</th>
                                <th style="width:15%">密码生命周期(天)</th>
                                <th style="width:15%">密码提醒时间</th>
                                <th style="width:10%">密码重用时间间隔</th>
                                <th style="width:10%">密码重用次数间隔</th>
                                <th style="width:10%">密码重用复杂度</th>
                                <th style="width:20%">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr class="empty" ng-if="vm.isLoading">
                                <td colspan="8" class="text-center">
                                    <span><i class="fa fa-spin fa-spinner"></i>数据加载中...</span>
                                </td>
                            </tr>
                            <tr class="empty" ng-if="!vm.isLoading && vm.empty">
                                <td colspan="8" class="text-center">
                                    <span><i class="fa fa-exclamation-circle"></i>暂无数据</span>
                                </td>
                            </tr>
                            <tr ng-if="!vm.isLoading && !vm.empty" ng-repeat="item in vm.dataList track by $index">
                                <td>{{$index + 1}}</td>
                                <td>{{item.name}}</td>
                                <td>{{item.effectDays}}</td>
                                <td>{{item.warnDays}}</td>
                                <td>{{item.reuseIntervalDays}}</td>
                                <td>{{item.reuseIntervalNums}}</td>
                                <td>{{item.pattern}}</td>
                                <td>
                                    <div class="btn-action text-center" ng-hide="item.confirm">
                                        <button ng-click="vm.openCreate(item)" class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i>编辑</button>
                                        <button type="button" class="btn btn-danger btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-trash"></i>删除</button>
                                    </div>
                                    <div class="btn-action" ng-hide="!item.confirm">
                                        <span ng-if="vm.dLoading"><i class="fa fa-spin fa-spinner"></i></span>
                                        <button class="btn btn-default btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-times"></i>取消</button>
                                        <button class="btn btn-primary btn-xs" ng-click="vm.del(item.id)"><i class="fa fa-check"></i>确定</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="row-pane">
                    <div class="pagination-group" ng-if="vm.hasPager">
                        <ui-pagination ng-show="vm.dataList" items-per-page="vm.page.perPage" total-items="vm.page.totalItems" ng-model="vm.page.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage(vm.page.currentPage)"></ui-pagination>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>